package com.jzo2o.customer.controller.agency;

import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.service.IBankAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/agency/bank-account")
@Api(tags = "机构端 - 服务人员或机构相关接口")
public class BankAccountController {
    @Autowired
    private IBankAccountService bankAccountService;
    @PostMapping
    public BankAccountResDTO bankCount(@RequestBody BankAccountUpsertReqDTO bankAccount){
        BankAccountResDTO bankAccountResDTO = bankAccountService.bankCount(bankAccount);
        return bankAccountResDTO;
    }

    /**
     * 5.3.2 获取当前用户银行账号接口
     */
    @GetMapping("/currentUserBankAccount")
    @ApiOperation("获取当前用户银行账号")
    public BankAccountResDTO queryWorkerBankAccount(@RequestParam(name = "_t") Long id) {
        return bankAccountService.queryAgencyBankAccount(id);
    }

}
